<?php

namespace App\Http\Controllers;

use App\Http\Requests\MCategory\AddRequest;
use App\Http\Requests\MCategory\DelRequest;
use App\Http\Requests\MCategory\EditRequest;
use App\Http\Requests\MCategory\IndexRequest;
use App\Models\GoodsCategory;

class MCategoryController extends Controller
{
    public function add(AddRequest $request)
    {
        $inputs = $request->validated();
        GoodsCategory::add($inputs);
        return $this->created();
    }

    public function index(IndexRequest $request)
    {
        $inputs = $request->validated();
        return GoodsCategory::index($inputs);
    }

    public function edit(EditRequest $request)
    {
        $inputs = $request->validated();
        GoodsCategory::edit($inputs);
        return $this->created();
    }

    public function del(DelRequest $request)
    {
        $inputs = $request->validated();
        GoodsCategory::del($inputs);
        return $this->created();
    }
}
